Skip to content

Added better error handling for the gRPC server. #592

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 21, 2020

Conversation

kittaakos
Copy link
Contributor

  • Consumers of the CLI have a better exit code when it fails at startup
  • Logged message to stdout, so gRPC clients know, it is time to connect

Signed-off-by: Akos Kitta [email protected]

// Invalid port, such as "Foo"
var dnsError *net.DNSError
if errors.As(err, &dnsError) {
logrus.Errorf("Failed to listen on TCP port: %s. %s is unknown name.", port, dnsError.Name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we do feedback.Errorf instead? This way the error will be always visible in the shell, not regarding of passing -v and will be added to the logs as well. Same for other occurrences of logrus.*

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the feedback. I have made the changes based on your request and left the original logrus.Fatalf("failed to serve: %v", err) as is.

@masci masci added this to the 0.9.0 milestone Feb 21, 2020
 - Consumers of the CLI have a better exit code when it fails at startup
 - Logged message to stdout, so gRPC clients know, it is time to connect

Signed-off-by: Akos Kitta <[email protected]>
@masci masci merged commit 1eefe49 into arduino:master Feb 21, 2020
@kittaakos kittaakos deleted the daemon-exit-code branch February 21, 2020 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants